package main

import "fmt"

func main() {

	apple := new(Apple)
	apple.Name = "富士"
	apple.TreeAge = 10
	fmt.Println(apple)
	//使用结构体字面量
	ap := Apple{Fruit{"红富士"}, 8}
	fmt.Println(ap)
}

// 水果结构体
type Fruit struct {
	Name string	"名称"
}
// 苹果结构体
type Apple struct {
	Fruit	//匿名字段
	TreeAge	int32 "树龄"
}